

class User{
  String? avatar;
  String? nickName;
  Token? token;
  int? userId;
  String? userNo;
  String? userSource;
  String? mobile;
  String? password;
  User({
    this.avatar,
    this.nickName,
    this.token,
    this.userId,
    this.userNo,
    this.userSource,
    this.mobile,
    this.password,
  });

  factory User.fromJson(Map<String, dynamic> json) {
    return User(
      avatar: json['avatar'],
      nickName: json['nickName'],
      token: json['token'] != null ? Token.fromJson(json['token']) : null,
      userId: json['userId'],
      userNo: json['userNo'],
      userSource: json['userSource'],
      mobile: json['mobile'],
      password: json['password'],
    );
  }

  Map<String, dynamic> toJson() {
    return {
      'avatar': avatar,
      'nickName': nickName,
      'token': token?.toJson(),
      'userId': userId,
      'userNo': userNo,
      'userSource': userSource,
      'mobile': mobile,
      'password': password,
    };
  }

}

class Token {
  String? accessToken;
  String? ticket;

  Token({this.accessToken, this.ticket});

  factory Token.fromJson(Map<String, dynamic> json) {
    return Token(
      accessToken: json['accessToken'],
      ticket: json['ticket'],
    );
  }

  Map<String, dynamic> toJson() {
    return {
      'accessToken': accessToken,
      'ticket': ticket,
    };
  }
}